home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Complete Linux
/
Complete Linux.iso
/
xwindows
/
demos
/
xfract_1.z
/
xfract_1
/
xfractint-1.06
/
fractalp.c
< prev
next >
Wrap
C/C++ Source or Header
|
1992-09-28
|
41KB
|
853 lines
/*
This module consists only of the fractalspecific structure
and a *slew* of defines needed to get it to compile
*/
/* includes needed for fractalspecific */
#include <stdio.h>
#include <stdlib.h>
#include "fractint.h"
#include "mpmath.h"
#include "helpdefs.h"
#include "fractype.h"
#include "prototyp.h"
/* functions defined elswhere needed for fractalspecific */
/* moved to prototyp.h */
/* parameter descriptions */
/* Note: parameters preceded by + are integer parameters */
/* for Mandelbrots */
static char realz0[] = "Real Perturbation of Z(0)";
static char imagz0[] = "Imaginary Perturbation of Z(0)";
/* for Julias */
static char realparm[] = "Real Part of Parameter";
static char imagparm[] = "Imaginary Part of Parameter";
/* for Newtons */
static char newtdegree[] = "+Polynomial Degree (> 2)";
/* for MarksMandel/Julia */
static char exponent[] = "Real part of Exponent";
static char imexponent[] = "Imag part of Exponent";
/* for Complex Newton */
static char realroot[] = "Real part of Root";
static char imagroot[] = "Imag part of Root";
static char realdegree[] = "Real part of Degree";
static char imagdegree[] = "Imag part of Degree";
/* for Lorenz */
static char timestep[] = "Time Step";
/* for formula */
static char p1real[] = "Real portion of p1";
static char p2real[] = "Real portion of p2";
static char p1imag[] = "Imaginary portion of p1";
static char p2imag[] = "Imaginary portion of p2";
/* trig functions */
static char recoeftrg1[] = "Real Coefficient First Function";
static char imcoeftrg1[] = "Imag Coefficient First Function";
static char recoeftrg2[] = "Real Coefficient Second Function";
static char imcoeftrg2[] = "Imag Coefficient Second Function";
/* MCP 7-7-91
static char recoefsqr[] = "Real Coefficient Square Term";
static char imcoefsqr[] = "Imag Coefficient Square Term";
*/
static char recoef2nd[] = "Real Coefficient Second Term";
static char imcoef2nd[] = "Imag Coefficient Second Term";
/* KAM Torus */
static char kamangle[] = "Angle (radians)";
static char kamstep[] = "Step size";
static char kamstop[] = "Stop value";
static char pointsperorbit[] = "+Points per orbit";
/* Newtbasin */
static char stripes[] = "Enter non-zero value for stripes";
/* Gingerbreadman */
static char initx[] = "Initial x";
static char inity[] = "Initial y";
/* popcorn */
static char step[] = "Step size";
/* bifurcations */
static char filt[] = "+Filter Cycles";
static char seed[] = "Seed Population";
/* bailout defines */
#define FTRIGBAILOUT 2500.0
#define LTRIGBAILOUT 64.0
#define STDBAILOUT 4.0
#define NOBAILOUT 0.0
struct fractalspecificstuff far fractalspecific[] =
{
/*
fractal name, parameter text strings, parameter values,
helptext, helpformula, flags,
xmin xmax ymin ymax int tojulia tomandel tofloat symmetry
|------|-----|-----|-----|--|--------|---------|--------|---------|
orbit fnct per_pixel fnct per_image fnct calctype fcnt bailout
|---------------|---------------|---------------|----------------|-------|
*/
"mandel", realz0, imagz0,"","",0,0,0,0,
HT_MANDEL, HF_MANDEL, WINFRAC,
-2.5, 1.5, -1.5, 1.5, 1, JULIA, NOFRACTAL, MANDELFP, XAXIS_NOPARM,
JuliaFractal, mandel_per_pixel,MandelSetup, StandardFractal, STDBAILOUT,
"julia", realparm, imagparm,"","",0.3,0.6,0,0,
HT_JULIA, HF_JULIA, WINFRAC,
-2.0, 2.0, -1.5, 1.5, 1, NOFRACTAL, MANDEL, JULIAFP, ORIGIN,
JuliaFractal, julia_per_pixel, JuliaSetup, StandardFractal, STDBAILOUT,
"*newtbasin", newtdegree,stripes, "","",3,0,0,0,
HT_NEWTBAS, HF_NEWTBAS, WINFRAC,
-2.0, 2.0, -1.5, 1.5, 0, NOFRACTAL, NOFRACTAL, MPNEWTBASIN, NOSYM,
NewtonFractal2, otherjuliafp_per_pixel, NewtonSetup, StandardFractal,NOBAILOUT,
"lambda", realparm, imagparm,"","",0.85,0.6,0,0,
HT_LAMBDA, HF_LAMBDA, WINFRAC,
-1.5, 2.5, -1.5, 1.5, 1, NOFRACTAL, MANDELLAMBDA, LAMBDAFP, NOSYM,
LambdaFractal, julia_per_pixel, JulialongSetup, StandardFractal,STDBAILOUT,
"*mandel", realz0, imagz0,"","",0,0,0,0,
HT_MANDEL, HF_MANDEL, WINFRAC,
-2.5, 1.5, -1.5, 1.5, 0, JULIAFP, NOFRACTAL, MANDEL, XAXIS_NOPARM,
JuliafpFractal,mandelfp_per_pixel, MandelfpSetup, StandardFractal, STDBAILOUT,
"*newton", newtdegree, "", "","",3,0,0,0,
HT_NEWT, HF_NEWT, WINFRAC,
-2.0, 2.0, -1.5, 1.5, 0, NOFRACTAL, NOFRACTAL, MPNEWTON, XAXIS,
NewtonFractal2, otherjuliafp_per_pixel, NewtonSetup, StandardFractal,NOBAILOUT,
"*julia", realparm, imagparm,"","",0.3,0.6,0,0,
HT_JULIA, HF_JULIA, WINFRAC,
-2.0, 2.0, -1.5, 1.5, 0, NOFRACTAL, MANDELFP, JULIA, ORIGIN,
JuliafpFractal, juliafp_per_pixel, JuliafpSetup, StandardFractal,STDBAILOUT,
"plasma", "Graininess Factor (.1 to 50, default is 2)",
"+Algorithm (0 = original, 1 = new)",
"+Random Seed Value (0 = Random, 1 = Reuse Last)",
"",2,0,0,0,
HT_PLASMA, HF_PLASMA, NOZOOM+NOGUESS+NOTRACE+NORESUME+WINFRAC,
-2.0, 2.0, -1.5, 1.5, 1, NOFRACTAL, NOFRACTAL, NOFRACTAL, NOSYM,
NULL, NULL, StandaloneSetup, plasma, NOBAILOUT,
"*mandelfn", realz0, imagz0,"","",0,0,0,0,
HT_MANDFN, HF_MANDFN, TRIG1+WINFRAC,
-8.0, 8.0, -6.0, 6.0, 0, LAMBDATRIGFP,NOFRACTAL, MANDELTRIG, XYAXIS_NOPARM,
LambdaTrigfpFractal,othermandelfp_per_pixel,MandelTrigSetup,StandardFractal,LTRIGBAILOUT,
"*manowar", realz0, imagz0,"","",0,0,0,0,
HT_SCOTSKIN, HF_MANOWAR, WINFRAC,
-2.5, 1.5, -1.5, 1.5, 0, MANOWARJFP, NOFRACTAL, MANOWAR, XAXIS_NOPARM,
ManOWarfpFractal,mandelfp_per_pixel, MandelfpSetup,StandardFractal,STDBAILOUT,
"manowar", realz0, imagz0,"","",0,0,0,0,
HT_SCOTSKIN, HF_MANOWAR, WINFRAC,
-2.5, 1.5, -1.5, 1.5, 1, MANOWARJ, NOFRACTAL, MANOWARFP, XAXIS_NOPARM,
ManOWarFractal,mandel_per_pixel, MandellongSetup,StandardFractal,STDBAILOUT,
"test","(testpt Param #1)","(testpt param #2)","(testpt param #3)","(testpt param #4)",0,0,0,0,
HT_TEST, HF_TEST, 0,
-2.0, 2.0, -1.5, 1.5, 0, NOFRACTAL, NOFRACTAL, NOFRACTAL, NOSYM,
NULL, NULL, StandaloneSetup, test, STDBAILOUT,
"sierpinski", "","","","",0,0,0,0,
HT_SIER, HF_SIER, WINFRAC,
-0.9, 1.7, -0.9, 1.7, 1, NOFRACTAL, NOFRACTAL, SIERPINSKIFP, NOSYM,
SierpinskiFractal,long_julia_per_pixel, SierpinskiSetup,StandardFractal,127.0,
"barnsleym1", realz0, imagz0,"","",0,0,0,0,
HT_BARNS, HF_BARNSM1, WINFRAC,
-2.0, 2.0, -1.5, 1.5, 1, BARNSLEYJ1,NOFRACTAL, BARNSLEYM1FP, XYAXIS_NOPARM,
Barnsley1Fractal,long_mandel_per_pixel,MandellongSetup,StandardFractal,STDBAILOUT,
"barnsleyj1", realparm, imagparm,"","",0.6,1.1,0,0,
HT_BARNS, HF_BARNSJ1, WINFRAC,
-2.0, 2.0, -1.5, 1.5, 1, NOFRACTAL, BARNSLEYM1, BARNSLEYJ1FP, ORIGIN,
Barnsley1Fractal,long_julia_per_pixel,JulialongSetup,StandardFractal,STDBAILOUT,
"barnsleym2", realz0, imagz0,"","",0,0,0,0,
HT_BARNS, HF_BARNSM2, WINFRAC,
-2.0, 2.0, -1.5, 1.5, 1, BARNSLEYJ2,NOFRACTAL, BARNSLEYM2FP, YAXIS_NOPARM,
Barnsley2Fractal,long_mandel_per_pixel,MandellongSetup,StandardFractal,STDBAILOUT,
"barnsleyj2", realparm, imagparm,"","",0.6,1.1,0,0,
HT_BARNS, HF_BARNSJ2, WINFRAC,
-2.0, 2.0, -1.5, 1.5, 1, NOFRACTAL, BARNSLEYM2, BARNSLEYJ2FP, ORIGIN,
Barnsley2Fractal,long_julia_per_pixel,JulialongSetup,StandardFractal,STDBAILOUT,
"sqr(fn)", "","","","",0,0,0,0,
HT_SCOTSKIN, HF_SQRFN, TRIG1+WINFRAC,
-4.0, 4.0, -3.0, 3.0, 16, NOFRACTAL, NOFRACTAL, SQRTRIGFP,XAXIS,
SqrTrigFractal, long_julia_per_pixel, SqrTrigSetup, StandardFractal,LTRIGBAILOUT,
"*sqr(fn)", "","","","",0,0,0,0,
HT_SCOTSKIN, HF_SQRFN, TRIG1+WINFRAC,
-4.0, 4.0, -3.0, 3.0, 0, NOFRACTAL, NOFRACTAL, SQRTRIG,XAXIS,
SqrTrigfpFractal, otherjuliafp_per_pixel, SqrTrigSetup, StandardFractal,LTRIGBAILOUT,
"fn+fn", recoeftrg1, imcoeftrg1,recoeftrg2, imcoeftrg2,1,0,1,0,
HT_SCOTSKIN, HF_FNPLUSFN, TRIG2+WINFRAC,
-4.0, 4.0, -3.0, 3.0, 16, NOFRACTAL, NOFRACTAL, TRIGPLUSTRIGFP,XAXIS,
TrigPlusTrigFractal, long_julia_per_pixel, TrigPlusTriglongSetup, StandardFractal,LTRIGBAILOUT,
"mandellambda",realz0, imagz0,"","",0,0,0,0,
HT_MLAMBDA, HF_MLAMBDA, WIN